package com.qf.compusdemo.service.Impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.qf.compusdemo.dao.mainDao;
import com.qf.compusdemo.entity.bullet;
import com.qf.compusdemo.service.mainService;
import com.qf.compusdemo.vo.BulletVo;
import com.qf.compusdemo.vo.tableVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Objects;

@Service
public class mainServiceImpl extends ServiceImpl<mainDao, bullet> implements mainService {


    @SuppressWarnings("SpringJavaInjectionPointsAutowiringInspection")
    @Autowired
    private mainDao md;


    @Override
    public IPage<bullet> getAllBullet(Page<bullet> page, bullet bb) {
        QueryWrapper wrapper=new QueryWrapper();
        if(!Objects.isNull(bb)){
            wrapper.eq("ggmessage",bb.getGgmessage());
        }


//        IPage<bullet> ipage=md.selectPage(page,wrapper);
        IPage<bullet> ipage=md.selectAll(page,bb.getGgmessage());

        return ipage;
    }

    @Override
    public int updateBullet(bullet bb) {
       return md.updateBullet(bb);
    }

    @Override
    public int del(List lists) {
        return md.deleteBatchIds(lists);
    }
}
